<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/Kongshop.css" rel="stylesheet"/>
		<link href="../../css/xq.css" />
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.6/lib/index.css">
		<!-- 引入组件 -->
		<script src="../../js/vue.min.js"></script>
		<script src="../../js/vue-lazyload.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/vant.min.js"></script>
		<script src="html5plus://ready"></script>
		<script src="../../js/listener_other.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../js/ajax.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			li{
				list-style-type: none;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<header>
				<van-nav-bar  @click-left="onClickLeft" title="搜索结果" left-text="返回" left-arrow id="a">
				</van-nav-bar>
				<van-row style="background-color: red; width: 100%; height: 60px; color: #E8E8E8;">
					
				</van-row>	
			</header>
			<section>
				<van-row>						
					<van-col span="24" >							
						<li v-for="(item, index) in list" :name="item.id">
							<van-card :num="item.count" @click="skipPd(item.Id)" :price="item.RealPrice" :origin-price="item.MarketPrice" :title="item.Name" @click="onClickUrl(index)">
								<img slot="thumb" src="../../img/photo.png" />
								<span slot="footer">
									<label style="padding-right: 20%;">累计销售{{item.VirtualSaleCount}}</label>
									<label>{{item.BrowseCount}}次浏览</label>
								</span>
							</van-card>
						</li>
					</van-col>
				</van-row>
			</section>
		</div>
		
		
		
		<script type="text/javascript">
			var vm=new Vue({
				el:'#app',
				data:{
					list: []
				},
				created:function(){
					var _this=this;
					var w = plus.webview.currentWebview();
					console.info(w.name);
					ajax({
						url: "http://dsapi.ysd3g.com/api/GoodsSearch",
						dataType: "jsonp",
						data: {
							name:w.name
						},
						success: function(res) {
							console.log(res);
							vm.list = res.Data;
							Vue.use(VueLazyload, {
								error: "../../img/photo.png"
							});
							console.log(_this.list);								
						}
					});
					if(w.name==""){
						ajax({
							url: "http://dsapi.ysd3g.com/api/IndexGoodsData",
							dataType: "jsonp",
							data: {
								p: 1
							},
							success: function(res) {
								//console.log(res);
								vm.list = res.Data;
								//console.log(_this.IndexGoodsData);
								var hm = plus.webview.getWebviewById("home");
								hm.reload(true);
							}
						});
					}
 				},
				methods:{
					skipPd(id) {
						var w = plus.webview.create("../home/shopxq.html", "shopxq", {}, {
							ID: id
						}); 
						w.show();
					},
					onClickLeft: function() {
						plus.webview.close(plus.webview.currentWebview(), "slide-out-left");
						console.log("返回个人页面")
					}
				}
			})
		</script>
	</body>
</html>
